package com.wyp.design.pattern.structural.composite;

/**
 * 场景分析：课程目录  包括目录和课程，
 * 组合模式也就是说面向接口编程，传递类型为接口或者父类（抽象类），需要注意类型匹配问题
 * @author: Oliver
 * @time: 2020/5/16/18:46
 */
public class CatalogComponent {
    public void add(CatalogComponent catalogComponent){
        throw new UnsupportedOperationException("不支持添加操作");
    }

    public void remove(CatalogComponent catalogComponent){
        throw new UnsupportedOperationException("不支持删除操作");
    }


    public String getName(CatalogComponent catalogComponent){
        throw new UnsupportedOperationException("不支持获取名称操作");
    }


    public double getPrice(CatalogComponent catalogComponent){
        throw new UnsupportedOperationException("不支持获取价格操作");
    }


    public void print(){
        throw new UnsupportedOperationException("不支持打印操作");
    }
}
